package com.srzk.youthleagueback.controller;

import com.srzk.youthleagueback.pojo.Meeting;
import com.srzk.youthleagueback.pojo.Registration;
import com.srzk.youthleagueback.results.Result;
import com.srzk.youthleagueback.service.MeetingService;
import com.srzk.youthleagueback.service.RegistrationService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/part2")
public class RegistrationController {
    @Autowired
    RegistrationService service;

    @GetMapping("/registration")
    public Result<HashMap<String,String>> getMeeting(@RequestParam("user")String user, @RequestParam("year")String year, @RequestParam("type")int type){
        return service.getRegistration(user,year,type);
    }

    @PostMapping("/registration")
    public Result<String> addMeeting(Registration registration){
        return service.addRegistration(registration);
    }


}
